﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sofire.DataComm.Remoting
{
#if !SILVERLIGHT
    [Serializable]
#else
#endif
    internal class MethodSyncInfo
    {
        public MethodSyncInfo() { }

        public MethodSyncInfo(int ident, string name, string[] parameterTypeStrings)
        {
            this.MethodIdent = ident;
            this.MethodName = name;
            this.ParameterTypeStrings = parameterTypeStrings;

        }
        public int MethodIdent;
        public string MethodName;

        private string[] ParameterTypeStrings;
#if SILVERLIGHT
        [Ignore]
#else
        [NonSerialized]
#endif
        private Type[] _ParameterTypes;
        public Type[] ParameterTypes
        {
            get
            {
                if(_ParameterTypes == null)
                {
                    _ParameterTypes = new Type[ParameterTypeStrings.Length];
                    for(int i = 0 ; i < ParameterTypeStrings.Length ; i++)
                    {
                        _ParameterTypes[i] = Type.GetType(ParameterTypeStrings[i]);
                    }
                }
                return _ParameterTypes;
            }
        }
    }
}
